
function stripTags(s, n) {
    return s.replace(/<.*?>/ig, '').split(/\s+/).slice(0, n - 1).join(' ');
}
function createSummaryAndThumb(pID) {
var summ = 22;
var p = document.getElementById(pID);
	p.innerHTML = '<p>' + stripTags(p.innerHTML,summ) + '...</p>'; 
}

function image_plugin(image_url,post_title)
{
var image_size=400;
var show_default_thumbnail=true;
var default_thumbnail="http://2.bp.blogspot.com/-erTXCq61ULM/TmHYAQBZ0GI/AAAAAAAACCs/6cBX54Dn6Gs/s72-c/default.png";
if(show_default_thumbnail == true && image_url == "") image_url= default_thumbnail;
image_tag='<img src="'+image_url.replace('/s72-c/','/s'+image_size+'/')+'" class="postthumb" alt="'+post_title+'" />';
if(image_url!="") return image_tag; else return "";
}

function readmore(id) {
var theDiv = document.getElementById("featured-image");
var p = document.getElementById(id);
    imgtag = "";
    ifrtag = "";
    img = p.getElementsByTagName("img");
    ifr = p.getElementsByTagName("iframe");
    if (ifr.length >= 1) ifrtag = '<div class="entry-video"><iframe width="100%" height="370px" src="' + ifr[0].src + '" frameborder="0" allowfullscreen style="display:block;"></iframe></div>';
    else if (img.length >= 1) imgtag = '<img class="thumb" src="' + img[0].src + '" />';
    else imgtag = '';
    theDiv.innerHTML = ifrtag + imgtag;
}

$(document)['ready'](function () {
    var _0x418ex1 = $('#ident')['val']();
    if (_0x418ex1 == null) {
        window['location']['href'] = 'http://creativ-me.blogspot.com/';
    };
    $('#ident')['attr']('href', 'http://creativ-me.blogspot.com/');
	$('#ident')['attr']('rel', 'dofollow');
    $('#ident')['text']('');
    $('#ident')['wrap']('<a href="http://creativ-me.blogspot.com/" rel="dofollow">مدونة أبدعني</a>');
	
	$('#ident2')['attr']('href', 'http://www.aquaweeb.com/');
	$('#ident2')['attr']('rel', 'dofollow');
    $('#ident2')['text']('');
    $('#ident2')['wrap']('<a href="http://www.aquaweeb.com/" rel="dofollow">مدونة أبدعني</a>');
});
$(document)['ready'](function () {
    if (!$('#ident')['is'](':visible')) {
        window['location']['href'] = 'http://creativ-me.blogspot.com/';
    };
});
